<?php
class User_Model extends CI_Model{
    function _construct(){
		parent::_construct();
	}
	
	function check_login($username , $password){
		$pass1= md5($password);
		$query= "SELECT id FROM users WHERE username = ? AND password = ?";
		$result= $this->db->query($query,array($username,$pass1));
		if ($result->num_rows() == 1){
			$result=$result->row();
			return $result->id;
		}else{
			return FALSE;
		}
	}
}
?>